import * as actionTypes from './constants'
import {
    getArchiveListRequest,
} from '@/api/request'

export const changeEnterLoading = (data) => ({
    type: actionTypes.CHANGE_SPACE_LOADING,
    data
})

const changeArchiveList = (data) => ({
    type: actionTypes.SET_ARCHIVELIST,
    data
})

export const getArchiveList = () => {
    return (dispatch) => {
        getArchiveListRequest()
            .then(data => {
                // console.log(data.data.list.vlist);
                dispatch(changeArchiveList(data.data.list.vlist))
                dispatch(changeEnterLoading(false))
            })
    }
}